binaryStrList = input().split()
binaryStr = ""
for item in binaryStrList:
    binaryStr += item

print(hex(int(binaryStr, 2)))